package com.shgsh.attribute.controller;

import com.shgsh.attribute.service.AttributeDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Evelyn on 2015/8/21.
 */
@Controller
@RequestMapping("attribute")
public class AttributeDataController {
    @Autowired
    AttributeDataService attributeDataService;


    @ResponseBody
    @RequestMapping("init")
    public String initUserAttribute(String userId) {
        attributeDataService.initAllAttrForUser(userId);
        return "init?userId=" + userId;
    }

    @ResponseBody
    @RequestMapping("setInitValue")
    public String setInitValue(String value) {
        attributeDataService.setInitAttrValue(value);
        return "setInitValue?value=" + value;
    }


}
